<?php
include(SYSTEM_ROOT . "lib/gestore_lingue.php");

switch ($this->_sesso) {
case "D":
	$descrSesso = ucfirst($ESCORT);
	$hrefList = $_SESSION['lingua_url']."$HREF_ANNUNCI_ESCORT";
	$hrefListCitta = $_SESSION['lingua_url']."$LISTA_ANNUNCI/$ESCORT";
	break;
case "U":
	$descrSesso = ucfirst($ACCOMPAGNATORE);
	$hrefList =  $_SESSION['lingua_url']."$ANNUNCI/$ACCOMPAGNATORI";
	$hrefListCitta =  $_SESSION['lingua_url']."$LISTA_ANNUNCI/$ACCOMPAGNATORI";
	break;
case "T":
	$descrSesso = ucfirst($TRANS);
	$hrefList =  $_SESSION['lingua_url']."$ANNUNCI/$TRANS";
	$hrefListCitta = $_SESSION['lingua_url']."$LISTA_ANNUNCI/$TRANS";
	break;   
default:
	$descrSesso = ucfirst($ESCORT);
	$hrefList =  $_SESSION['lingua_url']."$HREF_ANNUNCI_ESCORT";
	$hrefListCitta = $_SESSION['lingua_url']."$LISTA_ANNUNCI/$ESCORT";
}
?>
<link rel="stylesheet" type="text/css" media="screen" href="<?=$FILE_CSS?>" />
<div class="breadcrumb">
    <a href="/<?=$HREF_HOME?>" title="<?=ucfirst($ANNUNCI)?>"><img src="/images/element/lips.png" width="35" height="24" border="0" align="absmiddle" /><?=ucfirst($ANNUNCI)?></a>&nbsp;&raquo;&nbsp;<a href="<?=$hrefList; ?>" title="<?=$descrSesso; ?>"><?=$descrSesso; ?></a>
</div>
<br class="clearfloat" />
<div style="margin-top:10px;">
  <div>
	<?php
	
    while ($row = mysql_fetch_array($this->_res))
    {    
        $nome = stripslashes($row['nome']);
		
		if($nome=="")
			$nome = $row['username'];
			
		$user_id = $row['user_id'];
		$citta = $row['citta'];
		$translate = new Translate();
		$citta = $translate->TranslateCityName($citta);
		if($citta=="")
			$citta = $ITALIA;
					
		$nome_foto_principale = $row['nome_foto_principale'];	
		$total_votes = $row['total_votes'];			
		if($total_votes>0)  
    		$voto_medio = round($row['total_value']/$total_votes, 2);
		else
			$voto_medio = 0;
			
		$num_click_tot = $row['num_click_tot'];
		$num_click_mese = $row['num_click_mese'];
		$mese = $row['mese'];
		$anno = $row['anno'];
		
		if($mese==2 && $anno=2011)
			$num_click_mese = $num_click_mese+2000;
		
		switch ($mese) {
		case 1:
			$descrMese = $GENNAIO;	
			break;
		case 2:
			$descrMese = $FEBBRAIO;				
			break;
		case 3:
			$descrMese = $MARZO;				
			break;
		case 4:
			$descrMese = $APRILE;				
			break;
		case 5:
			$descrMese = $MAGGIO;				
			break;
		case 6:
			$descrMese = $GIUGNO;				
			break;
		case 7:
			$descrMese = $LUGLIO;				
			break;
		case 8:
			$descrMese = $AGOSTO;				
			break;
		case 9:
			$descrMese = $SETTEMBRE;				
			break;
		case 10:
			$descrMese = $OTTOBRE;				
			break;
		case 11:
			$descrMese = $NOVEMBRE;				
			break;
		case 12:
			$descrMese = $DICEMBRE;				
			break;
		default:
			$descrMese = "";	
		}
		
		$obj = new Main();
        $nome_url = $obj->CleanStringForUrl($nome);
		$citta_url = $obj->CleanStringForUrl($citta);
				
		switch ($row['sesso']) {
		case "D":
			if($row['tipo_class']=="L")
				$href = $_SESSION['lingua_url']."$user_id/$HREF_ANNUNCI_LUXURY_ESCORT/$citta_url/$nome_url";		
			else
				$href =  $_SESSION['lingua_url']."$user_id/$HREF_ANNUNCI_ESCORT/$citta_url/$nome_url";
			break;
		case "U":
			$href = $_SESSION['lingua_url']."$user_id/$ANNUNCI/$ACCOMPAGNATORI/$citta_url/$nome_url";
			break;
		case "T":
			if($row['tipo_class']=="L")
				$href = $_SESSION['lingua_url']."$user_id/$ANNUNCI/$LUXURY-top-$TRANS/$citta_url/$nome_url";		
			else
				$href = $_SESSION['lingua_url']."$user_id/$ANNUNCI/$TRANS/$citta_url/$nome_url";
			
			break;   
		default:
			$href = $_SESSION['lingua_url']."$user_id/$HREF_ANNUNCI_ESCORT/$citta_url/$nome_url";
		}
		
		switch ($row['tipo_class']) {
		case "T":
			$descrSesso = "Top Escort";
			$class_box = "boxgrid2topclass caption2";
			$class_box_cover = "cover boxcaption2topclass";	
			$icons = "/images/element/heartz.png";			
			break;
		case "L":
			$descrSesso = "Escort Luxury";
			$class_box = "boxgrid2luxury caption2";
			$class_box_cover = "cover boxcaption2luxury";
			$icons = "/images/element/starz.png";					
			break;
		default:
			$class_box = "boxgrid2 caption2";
			$class_box_cover = "cover boxcaption2";	
			$icons = "/images/element/ribbonz.png";	
		}
		
		$title = $nome." ".$descrSesso." ".$citta;
		//die($class_box);
		?>
    <div style="width:282px; margin-right:5px; float:left">
      <div style="float:left">
        <div><b><?=$descrMese." ".$anno;?></b></div>
			<div class="<?=$class_box?>">		
				<a href="<?=$href; ?>"><img src="/images/users/box/<?=$nome_foto_principale?>" width="110px" title="<?=$title?>" ></a>
				<div class="<?=$class_box_cover?>" style="top: 124px;">
					<h4><img src="<?=$icons?>"><a href="<?=$href; ?>"><?=$nome?></a></h4>
					<p><?=$citta?></p>
				</div>
	  </div></div>
            <div style="float:right; margin:22px 2px; position:relative"><?=$VISITE?> tot.:<strong> <?=$num_click_tot?></strong><br />
      <?=$VISITE." ".$MESE?>:<strong> <?=$num_click_mese?></strong><br />
      rating:<strong> <?=$voto_medio?></strong> (<?=$total_votes?> <?=$VOTI?>)<br /><img src="/images/element/ico-escort-superstar.png" style="margin-top:10px"></div>
    </div>    
        <?		
    }
    mysql_free_result($this->_res);    
	?>
	</div>
</div>    
